Repository navigation
diagnose(shell): trace the grid size at output consumption (#194) - #195
Conversation
TERMFORGE_OUTPUT_TRACE records terminal id, byte offset, chunk size and current grid per consumed chunk, so a resize repaint can be shown to have been generated for the previous geometry while the grid already had the new one.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5dd3a9d5cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (trace_output_) { | ||
| trace_output_ << "{\"schema\":\"termforge-output-trace-v1\",\"terminal\":" << identity_ | ||
| << ",\"t_ms\":" << GetTickCount64() | ||
| << ",\"offset\":" << trace_offset_ << ",\"bytes\":" << bytes.size() |
There was a problem hiding this comment.
Record offsets into the shared capture file
In multi-session scenarios, every ShellWindow appends to the same TERMFORGE_CAPTURE_OUTPUT file configured by execute(), but trace_offset_ starts at zero independently for each window. Consequently, the second terminal's first trace entry reports offset 0 even though its bytes follow another terminal's output, and subsequent offsets remain incorrect whenever sessions interleave. This makes the new offset/geometry evidence point at unrelated bytes in output.bin, undermining resize diagnosis. Record the actual shared capture position for each chunk, or give each terminal a separate capture file whose offsets match this counter.
Useful? React with 👍 / 👎.
内容
新增 opt-in 的输出消费轨迹
TERMFORGE_OUTPUT_TRACE=<path>:每个被消费的输出块写一行{"schema":"termforge-output-trace-v1","terminal":1,"t_ms":...,"offset":0,"bytes":347,"columns":111,"rows":7}terminal区分同一场景里的多个窗口;offset/bytes可和output.bin对齐到具体字节;columns/rows是消费该块时的网格尺寸。runner 自动指向场景产物目录的
output-trace.jsonl。动机(#194)
#194 已确认:resize 期间 ConPTY 的尾部重绘是按旧几何生成、被按新几何消费,错位量 = 高度差(本轮 10−7=3),导致行内容等长互换、选区失效。
要证实"新旧尺寸的先后",就需要"消费时刻的网格尺寸"这一证据——本 PR 提供的正是它。
本地验证
边界
Refs #194 #156